// @ts-ignore
/* eslint-disable */
import request from "@/plugins/globalRequest";

/** 添加种植户信息 POST /admin/insertGrowerInformation */
export async function insertGrowerInformationUsingPOST(
  body: API.GrowerInformation,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/insertGrowerInformation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询种植户信息 POST /admin/pageQueryGrower */
export async function pageQueryGrowerUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pageQueryGrowerUsingPOSTParams,
  body: API.GrowerInformation,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultPageQueryCondition_>('/growerInfo/pageQueryGrower', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据ID查询种植户 GET /admin/queryGrowerById/${param0} */
export async function queryGrowerByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryGrowerByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultGrowerInformation_>(`/admin/queryGrowerById/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新种植户信息 POST /admin/updateGrowerInformation */
export async function updateGrowerInformationUsingPOST(
  body: API.GrowerInformation,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/updateGrowerInformation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
